<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.infodms.dms.bean.TtAsActivityBean"%>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<html xmlns="http://www.w3.org/1999/xhtml">
<%@taglib uri="/jstl/cout" prefix="c"%>
<%@page import="com.infodms.dms.common.Constant"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>服务活动管理</title>
<%
String contextPath = request.getContextPath();
%>
<%
			TtAsActivityBean ActivityBean = (TtAsActivityBean) request.getAttribute("ActivityBean");//服务活动信息-明细
	// List<TtAsActivityBean> ActivityBeanList=(List<TtAsActivityBean>)request.getAttribute("ActivityBeanList");//活动工时
	// List<TtAsActivityBean> ActivityPartsList=(List<TtAsActivityBean>)request.getAttribute("ActivityPartsList");//活动配件
	// List<TtAsActivityBean> ActivityNetItemList=(List<TtAsActivityBean>)request.getAttribute("ActivityNetItemList");//活动其它项目
	//List<TtAsActivityBean> ActivityVhclMaterialGroupList=(List<TtAsActivityBean>)request.getAttribute("ActivityVhclMaterialGroupList");//活动其它项目
	// List<TtAsActivityBean> ActivitygetActivityAgeList=(List<TtAsActivityBean>)request.getAttribute("ActivitygetActivityAgeList");//车龄定义列表
%>
<%
			//List<TtAsActivityBean> ActivityCharactorList = (List<TtAsActivityBean>) request.getAttribute("ActivityCharactorList");//车辆性质
%>
<%
TtAsActivityBean beforeVehicle = (TtAsActivityBean) request.getAttribute("beforeVehicle");//服务活动信息-服务车辆活动范围
TtAsActivityBean afterVehicle = (TtAsActivityBean) request.getAttribute("afterVehicle");//服务活动信息-服务车辆活动范围
%>	
<script type="text/javascript">
function doInit()
{
   checkDirect();
   checkType();
}
//服务活动-车辆信息
function openCharactor(){
	//disableBtn($("commitBtn"));//点击按钮后，按钮变成灰色不可用;
	var activityId =document.getElementById("activityId").value;
	OpenHtmlWindow('<%=contextPath%>/claim/serviceActivity/ServiceActivityManage/getActivityVehicleListInfoInit.do?activityId='+activityId,800,500);
}
function fix(show){
    if(document.fm.isFixfee.checked==true){
     show.style.display ="block";
     }else{
     show.style.display ="none";
     }
}

// 控制显示（工时、配件、其他项目和授权信息）
function showClaimDetail(tableId,checkBoxObj){

	if('all'==tableId){
		var laborT = document.getElementById('labourTable');
		var partT = document.getElementById('partTable');
		var otherT = document.getElementById('otherTable');
		var authT = document.getElementById('authTable');
		var ageT = document.getElementById('ageTable');
		var charactorT = document.getElementById('charactorTable');
		var milage = document.getElementById('milageTable');
		if(checkBoxObj.checked){
			laborT.style.display='';
			partT.style.display='';
			otherT.style.display='';
			authT.style.display='';
			ageT.style.display='';
			milage.style.display='';
			//charactorT.style.display='';
		}else{
			laborT.style.display='none';
			partT.style.display='none';
			otherT.style.display='none';
			authT.style.display='none';
			ageT.style.display='none';
			charactorT.style.display='none';
			//milage.style.disaply='';
		}
	}else {
		var temp = document.getElementById(tableId);
		if(checkBoxObj.checked){
			temp.style.display = '';
		}else{
			temp.style.display = 'none';
		}
	}
	changeCheckBox(tableId,checkBoxObj);
}
//控制CheckBox（工时、配件、其他项目和授权信息）状态
function changeCheckBox(tableId,checkBoxObj){
	if('all'==tableId){
		var cbArray = document.getElementsByName('bt_back');
		var status = checkBoxObj.checked;
		for(var i=0;i<cbArray.length;i++){
			cbArray[i].checked = status;
		}
	}else{
		var allCB = document.getElementById('ckbAll');
		if(checkBoxObj.checked)
			allCB.checked = false;
		else
			allCB.checked = false;
	}
}
//活动类别的联动
function checkType(){
	if('<%=Constant.SERVICEACTIVITY_KIND_02%>'=='<%=ActivityBean.getActivityKind()%>'){
		$('show').style.display='block';
		$('activityFee').value = '' ;
		$('isFixfee').checked = true ;
		$('isFixfee').disabled = true ;
	}
}
checkType();
// 结算指向的联动
function checkDirect(){
	if('0'!='<%=ActivityBean.getSetDirect()%>'){
		$('default').checked = false ;
		$('directed').checked = true ;
		$('yieldly1').style.display = 'block' ;
	}			
}
checkDirect();
</script>
</head>

<body onLoad="fix(show)">
	<div class="navigation">
	   <img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置：售后服务管理&gt;服务活动管理&gt;服务活动管理
	</div>
<form method="post" name="fm">
<input type="hidden" id="activityId" name="activityId" value="<%=ActivityBean.getActivityId()%>" />
<table class="table_edit">
			<tr>
				<td width="10%" align="right">活动编号：</td>
				<td width="20%">
				<input type="hidden" id="milage" value="<%=ActivityBean.getMilageConfine() %>"> 
				<%=ActivityBean.getActivityCode()%></td>
			</tr>
			<tr>
			    <td width="10%" align="right">活动名称：</td>
				<td width="20%"><%=ActivityBean.getActivityName()%></td>
				<td width="10%" align="right">活动类型：</td>
				<td width="20%">
					<script type='text/javascript'>
				       var activityType=getItemValue('<%=ActivityBean.getActivityType()%>');
				       document.write(activityType) ;
				     </script>
			     </td>
			</tr>
			<tr>
			    <td width="10%" align="right">活动类别：</td>
				<td width="20%">
					 <script type='text/javascript'>
				       var activityKind=getItemValue('<%=ActivityBean.getActivityKind()%>');
				       document.write(activityKind) ;
				     </script>
			     </td>
				<td width="10%" align="right"> 活动日期： </td>
				<td width="20%">
					<%=ActivityBean.getStartdate()%>至<%=ActivityBean.getEnddate()%>
				</td>
			</tr>
			<tr>
				<td width="10%" align="right">活动结束日期后&nbsp;&nbsp;</td>
				<td width="20%"><%=ActivityBean.getUploadPrePeriod()%> &nbsp;天内上传</td>
				<td width="10%" align="right">处理方式：</td>
				<td width="20%">
					<script type='text/javascript'>
				       var dealwith=getItemValue('<%=ActivityBean.getDealwith()%>');
				       document.write(dealwith) ;
				    </script>
			    </td>
			</tr>
			<tr>
		<td width="10%" align="right">单台次活动次数：</td>
		<td width="20%">
			<%=ActivityBean.getSingleCarNum()%>
		</td>
		<td width="10%" align="right">单经销商活动总次数：</td>
		<td>
			<%=ActivityBean.getMaxCar()%>
		</td>
	</tr>
			<tr>
     	<td width="10%" align="right">服务活动车辆范围：</td>
     	<td width="20%">
     	  <input type="checkbox" value="<%=beforeVehicle.getCodeId()%>" name="beforeVehicle" id="beforeVehicle"
     	   <%if("11321001".equals(request.getAttribute("vicle1"))) {%>checked="checked"  <%}%>   disabled="disabled" />
     	  <script type='text/javascript'>
				       var beforeVehicle=getItemValue('<%=beforeVehicle.getCodeId()%>');
				       document.write(beforeVehicle) ;
		 </script>
     	 <input type="checkbox" value="<%=afterVehicle.getCodeId()%>" name="afterVehicle" id="afterVehicle"
     	   <%if("11321002".equals(request.getAttribute("vicle2"))) {%>checked="checked"  <%}%> disabled="disabled"  />
     	 <script type='text/javascript'>
				       var afterVehicle=getItemValue('<%=afterVehicle.getCodeId()%>');
				       document.write(afterVehicle) ;
		 </script>
     	</td>
     	<td width="10%" align="right">结算指向：</td>
     	<td width="20%">
     		<input type="radio" name="default" id="default" value="1" checked onclick="showYieldly(0);"/>按生产基地结算
     		<input type="radio" name="default" id="directed" value="2" onclick="showYieldly(1);"/>定向结算
     		<span id="yieldly1" style="display:none">
     			<script type="text/javascript">
     				var afterVehicle=getItemValue('<%=ActivityBean.getSetDirect()%>');
			       	document.write(afterVehicle) ;
				</script>
     		</span>
     	</td>
	</tr>
			<tr id="show">
			    <td width="10%" align="right">活动费用：</td>
				<td width="20%"><%=ActivityBean.getActivityFee()%></td>
				<!--
				<td class="table_edit_2Col_label_5Letter">配件费用：</td>
				<td align="left"><%=ActivityBean.getPartFee()%></td>
				<td class="table_edit_2Col_label_5Letter">工时费用：</td>
				<td align="left"><%=ActivityBean.getWorktimeFee()%></td>
			    -->
			   <td width="10%" align="right" >里程限制：</td>
			<td width="20%">
			<input type="radio" name="misage" id="a" value="<%=Constant.ACTIVI_MILAGE_YES %>" onClick="y_e();" disabled/>是
     		<input type="radio" name="misage" id="b" value="<%=Constant.ACTIVI_MILAGE_NO %>" onClick="n_o();"disabled/>否
			</tr>
			<tr>
				<td width="10%" align="right"></td>
				<td width="20%">
					<input type="checkBox" name="isClaim" value="<%=ActivityBean.getIsClaim()%>"
						<%if("0".equals(ActivityBean.getIsClaim())) {%> checked="checked"
						<%}%> disabled="disabled" />索赔
				</td>
				<td width="10%" align="right"></td>
				<td width="20%">
				<input type="checkBox" name="isFixfee" id="isFixfee" disabled="disabled" value="<%=ActivityBean.getIsFixfee()%>"
					<%if("1".equals(ActivityBean.getIsFixfee())) {%> checked="checked"
					<%}%> /> 
						<script type="text/javascript">
		        		if(document.fm.isFixfee.checked==true){
		        			document.fm.isClaim.checked=true;
		        			show.style.display ="block";
		        		}else {
		        		 	show.style.display ="none";
		        		}
	          		   </script>索赔是否为固定费用
            </td>
			</tr>
			
			<tr>
		<td width="10%" align="right">解决方案说明：</td>
		<td colspan="3" align="left">
			<textarea name="solution" id="solution" class="SearchInput" disabled="disabled" rows="8" cols="85" datatype="0,is_digit_letter_cn,200"><%=ActivityBean.getSolution()==null?"":ActivityBean.getSolution()%></textarea>
		</td>
	</tr>
	<tr>
		<td width="10%" align="right">索赔申请指导：</td>
		<td colspan="3" align="left">
			<textarea name="claimGuide" id="claimGuide" class="SearchInput" disabled="disabled" rows="8" cols="85" datatype="0,is_digit_letter_cn,200"><%=ActivityBean.getClaimGuide()==null?"":ActivityBean.getClaimGuide()%></textarea>
		</td>
	</tr>
</table>
<br />
<!-- 控制显示信息  -->
<table class="table_edit">
	<tr>
		<td width="13%">
			<input type="checkbox" value="true" id="ckbAll" name="ckbAll" onclick="showClaimDetail('all',this);" /> 全部显示</td>
		<td width="13%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('labourTable',this);" /> 活动工时</td>
		<td width="13%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('partTable',this);" /> 活动配件
		</td>
		<td width="15%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('otherTable',this);" /> 活动其它项目
		</td>
		<td width="13%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('authTable',this);" /> 车型列表
		</td>
		<td width="15%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('ageTable',this);" /> 车龄定义列表
		</td>
		<td width="15%">
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('charactorTable',this);" /> 车辆性质 
		</td>
		<td width="15%" nowrap>
			<input type="checkbox" name="bt_back" onclick="showClaimDetail('milageTable',this);" /> 里程限制
		</td>
	</tr>
</table>
<br />
<table id="labourTable" width="95%" border="0" class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="3" align="left">
		<img class="nav" src="<%=contextPath%>/img/subNav.gif" /> 活动工时
		</th>
	</tr>
	<tr>
		<th><b>工时代码</b></th>
		<th><b>工时名称</b></th>
		<th><b>工时数</b></th>
	</tr>
	<c:forEach var="ActivityBeanList" items="${ActivityBeanList}">
		<tr class="table_list_row1">
			<td><c:out value="${ActivityBeanList.itemCode}"></c:out></td>
			<td><c:out value="${ActivityBeanList.itemName}"></c:out></td>
			<td><c:out value="${ActivityBeanList.normalLabor}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<br />

<table id="partTable" width="95%" border="0" class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="2" align="left">
		<img class="nav" src="<%=contextPath%>/img/subNav.gif" /> 活动配件
		</th>
	</tr>
	<tr>
		<th><b>配件代码</b></th>
		<th><b>配件名称</b></th>
	</tr>
	<c:forEach var="ActivityPartsList" items="${ActivityPartsList}">
		<tr class="table_list_row1">
			<td><c:out value="${ActivityPartsList.partNo}"></c:out></td>
			<td><c:out value="${ActivityPartsList.partName}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<br />

<table id="otherTable" width="95%" border="0" class="table_list" 	style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="2" align="left">
			<img class="nav" src="<%=contextPath%>/img/subNav.gif" /> 活动其它项目
		</th>
	</tr>
	<tr>
		<th><b>其他项目代码</b></th>
		<th><b>其他项目名称</b></th>
	</tr>
	<c:forEach var="ActivityNetItemList" items="${ActivityNetItemList}">
		<tr class="table_list_row1">
			<td><c:out value="${ActivityNetItemList.itemCodes}"></c:out></td>
			<td><c:out value="${ActivityNetItemList.itemDesc}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<br />
<table id="authTable" width="95%" border="0" class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="4" align="left">
			<img class="nav" src="<%=contextPath%>/img/subNav.gif" /> 车型列表
		</th>
	</tr>
	<tr>
		<th><b>车型大类</b></th>
		<th><b>车系名称</b></th>
		<th><b>车型名称</b></th>
		<th><b>车型代码</b></th>
	</tr>
	<c:forEach var="ActivityVhclMaterialGroupList" items="${ActivityVhclMaterialGroupList}">
		<tr class="table_list_row1">
			<td>${ActivityVhclMaterialGroupList.groupCode}</td>
			<td><c:out value="${ActivityVhclMaterialGroupList.groupName}"></c:out></td>
			<td><c:out value="${ActivityVhclMaterialGroupList.parentGroupName}"></c:out></td>
			<td>${ActivityVhclMaterialGroupList.parentGroupCode}</td>
		</tr>
	</c:forEach>
</table>
<br />
<table id="ageTable" width="95%" border="0" class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="6" align="left">
			<img class="nav" src="<%=contextPath%>/img/subNav.gif" /> 车龄定义列表
		</th>
	</tr>
	<tr>
		<th>日期类型</th>
		<th><b>起始日期</b></th>
		<th><b>截止日期</b></th>
	</tr>
	<c:forEach var="ActivitygetActivityAgeList"
		items="${ActivitygetActivityAgeList}">
		<tr class="table_list_row1">
			<td>
				<script type="text/javascript">
					document.write(getItemValue(${ActivitygetActivityAgeList.dateType}));
				</script>
			</td>
			<td><c:out value="${ActivitygetActivityAgeList.saleDateStart}"></c:out></td>
			<td><c:out value="${ActivitygetActivityAgeList.saleDateEnd}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<br />
<table id="charactorTable" width=95% border=0 class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
    <tr>
		<th colspan="3" align="left">
			<img class="nav" src="<%=contextPath%>/img/subNav.gif"> 车辆性质
		</th>
	</tr>
	<c:forEach var="ActivityCharactorList" items="${ActivityCharactorList}">
		<tr class="table_list_row1">
			<td><c:out value="${ActivityCharactorList.codeDesc}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<table id="milageTable" width="95%" border="0" class="table_list" style="border-bottom: 1px solid #DAE0EE; display: none">
	<tr>
		<th colspan="3" align="left" nowrap>
			<img class="nav" src="<%=contextPath%>/img/subNav.gif" />里程限制
		</th>
	</tr>
	<tr>
		<th><b>保养次数</b></th>
		<th><b>起始里程</b></th>
		<th><b>结束里程</b></th>
	</tr>
	<c:forEach var="milageList" items="${ActivityMileageList}">
		<tr class="table_list_row1">
			<td>${milageList.FREE_TIMES}</td>
			<td><c:out value="${milageList.MILAGE_START}"></c:out></td>
			<td><c:out value="${milageList.MILAGE_END}"></c:out></td>
		</tr>
	</c:forEach>
</table>
<br />
<table width="95%" border="0" align="center" cellpadding="4"
	cellSpacing="1">
	<tr>
		<td><input type="button" name="vehicleInfo" value="车辆信息" class="normal_btn" onclick="openCharactor();" id="commitBtn"/> 
			<input type="button" name="bt_back" class="normal_btn" onclick="javascript:history.go(-1)" value="返回"/>
		</td>
	</tr>
</table>
</form>
<script type="text/javascript">
if($('milage').value==1){
	$('a').checked=true;
	
}else{
  $('b').checked=true;
  $('milage_add').disabled=true;
}
</script>
</body>
</html>